package com.example.Builder3;

class Waiter {
    private PizzaBuilder pizzaBuilder;

    /*设置构建器*/
    public void setPizzaBuilder(PizzaBuilder pizzaBuilder) {
        this.pizzaBuilder = pizzaBuilder;
    }
    public Pizza getPizza() {
        return pizzaBuilder.getPizza();
    }

    public void construct() {/*构建*/
        pizzaBuilder.createNewPizza();
        pizzaBuilder.buildParts();
    }
}